from flask import Flask, session, redirect, url_for, escape, request, url_for, redirect
import os
from pm.views import myjsonify
from flask_mail import Mail

app = Flask(__name__.split('.')[0])
from config import Production

#if app.config['DEV'] == True:
#app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:postgres@localhost:5432/postgres'
#else:
app.config.from_object(Production)

mail = Mail(app)
app.config.update(
                  #MAIL SETTINGS
                  MAIL_SERVER='smtp.gmail.com',
                MAIL_PORT=465,
                MAIL_USE_SSL=True,
                MAIL_USERNAME = 'phetamanager@gmail.com',
                MAIL_PASSWORD = 'victorfranco'
                  )
mail = Mail(app)
#app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:postgres@localhost:5432/produccion'
#app.config['SQLALCHEMY_DATABASE_URI'] = Production
#init_db()    
import database

#----------------------------------------------------------------------------------------
from views import LoginViews
from views import UsuariosViews
from views import PermisosViews
from views import RolesViews
from views import ProyectosViews
from views import FasesViews
from views import MiembrosComiteViews
from views import TipoItemViews
from views import AtributosViews
from views import TipoItemAtributosViews
from views import TiposItemFasesViews
from views import ItemViews
from views import RelacionesViews
from views import LineaBaseViews
from views import SolicitudCambioViews
from views import ArchivosViews
from views import ReportViews
from views import GrafosProyectoViews
#----------------------------------------------------------------------------------------




@app.route('/')
def index():
    return redirect(url_for('static', filename='index/app.html'))